package ui.activity;

import com.stuassist.ui.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ShowCourse extends Activity {
	private Button showCourse_back; //返回按钮
	private Button showCourse_ok; //确定按钮
	private Button showCourse_cancel; //取消按钮
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_show_course);
		this.showCourse_back=(Button)findViewById(R.id.showCourse_back);
		this.showCourse_back.setOnClickListener(new OnClickListener(){
			@Override
		    public void onClick(View view) {
			Intent intent = new Intent(ShowCourse.this,MainActivity.class);
			startActivity(intent);}
	      });//返回按钮事件的响应
		this.showCourse_ok=(Button)findViewById(R.id.showCourse_ok);
		this.showCourse_ok.setOnClickListener(new OnClickListener(){
			@Override
		    public void onClick(View view) {
			Intent intent = new Intent(ShowCourse.this,MainActivity.class);
			startActivity(intent);}
	      });//确定按钮事件的响应
		this.showCourse_cancel=(Button)findViewById(R.id.showCourse_cancel);
		this.showCourse_cancel.setOnClickListener(new OnClickListener(){
			@Override
		    public void onClick(View view) {
			Intent intent = new Intent(ShowCourse.this,MainActivity.class);
			startActivity(intent);}
	      });//取消按钮事件的响应
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_show_course, menu);
		return true;
	}
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_BACK){
			ShowCourse.this.finish();
			Intent intent = new Intent(ShowCourse.this,MainActivity.class);
			startActivity(intent);
		}
		return false;
	}
}
